<template>
  <div class="my">
    <div class="top">
      <div class="top-info">
        <div class="left">
          <div class="left-title">{{ userInfo.nickname }}</div>
          <div class="left-txt">{{ userInfo.intro }}</div>
        </div>
        <img
          v-if="userInfo.avatar"
          :src="baseUrl + userInfo.avatar"
          class="right"
          alt=""
        />
        <img v-else src="@/assets/logo.png" class="right" alt="" />
      </div>
      <ul class="top-num">
        <li class="top-num-item">
          <div class="num">298</div>
          <div class="txt">累积答题</div>
        </li>
        <li class="top-num-item">
          <div class="num">298</div>
          <div class="txt">收藏题目</div>
        </li>
        <li class="top-num-item">
          <div class="num">298</div>
          <div class="txt">我的错题</div>
        </li>
        <li class="top-num-item">
          <div class="num">298</div>
          <div class="txt">正确率</div>
        </li>
      </ul>
      <div class="position">
        <!-- <van-cell is-link center class="cell">
          <template #icon>
            <i class="iconfont">&#xe64d;</i>
          </template>
          <template #title>
            <div class="cell-title">
              我的岗位
            </div>
          </template>
          <template #default>
            <div class="cell-value">
              铲平精力
            </div>
          </template>
        </van-cell> -->
        <myCell
          class="cell"
          icon="&#xe64d;"
          title="我的岗位"
          value="产品经理"
        ></myCell>
      </div>
    </div>
    <div class="content">
      <div class="middle">
        <h3 class="middle-title">面经数据</h3>
        <ul class="middle-num">
          <li class="middle-num-item">
            <div class="item-1">昨日阅读<span class="color">+300</span></div>
            <div class="item-2">17</div>
            <div class="item-3">阅读总数</div>
          </li>
          <li class="middle-num-item">
            <div class="item-1">昨日阅读<span class="color">+300</span></div>
            <div class="item-2">17</div>
            <div class="item-3">阅读总数</div>
          </li>
          <li class="middle-num-item">
            <div class="item-1">昨日阅读<span class="color">+300</span></div>
            <div class="item-2">17</div>
            <div class="item-3">阅读总数</div>
          </li>
        </ul>
      </div>
      <div class="bottom">
        <myCell
          class="cell cell-1"
          icon="&#xe655;"
          title="我的我的面经分享"
          value="21"
        ></myCell>
        <myCell
          class="cell"
          icon="&#xe656;"
          title="我的消息"
          value="98"
        ></myCell>
        <myCell
          class="cell"
          icon="&#xe654;"
          title="收藏的题库"
          value="32"
        ></myCell>
        <myCell
          class="cell"
          icon="&#xe648;"
          title="收藏的企业"
          value="32"
        ></myCell>
        <myCell
          class="cell"
          icon="&#xe64f;"
          title="我的错题"
          value="123"
        ></myCell>
        <myCell
          class="cell cell-2"
          icon="&#xe63c;"
          title="收藏的面经经验"
          value="166"
        ></myCell>
      </div>
    </div>
  </div>
</template>

<script>
//导入 注册 使用
import myCell from './myCell'
//mapsState
import { mapState } from 'vuex'
export default {
  name: 'Myvue',
  data () {
    return {
      baseUrl: process.env.VUE_APP_URL
    }
  },
  components: {
    myCell
  },
  computed: {
    ...mapState(['userInfo', 'isLogin'])
  }
}
</script>

<style lang="less" scoped>
.my {
  .top {
    position: relative;
    background: linear-gradient(45deg, #ce0031, #b8002c);
    padding: 31px @p15 55px;
    .top-info {
      display: flex;
      justify-content: space-between;
      align-items: center;
      .left {
        .left-title {
          font-size: 21px;
          font-family: PingFangSC, PingFangSC-Semibold;
          font-weight: 600;
          text-align: left;
          color: #ffffff;
          line-height: 30px;
          letter-spacing: 0px;
        }
        .left-txt {
          opacity: 0.7;
          font-size: 12px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: left;
          color: #ffffff;
          line-height: 16px;
          letter-spacing: 0px;
        }
      }
      .right {
        width: 50px;
        height: 50px;
        border: 3px solid rgba(255, 255, 255, 0.38);
        border-radius: 50%;
      }
    }
    .top-num {
      display: flex;
      justify-content: space-between;
      align-items: center;

      .top-num-item {
        text-align: center;
        margin-top: 31px;

        .num {
          font-size: 21px;
          font-family: PingFangSC, PingFangSC-Semibold;
          font-weight: 600;
          text-align: center;
          color: #ffffff;
          line-height: 30px;
          letter-spacing: 0px;
        }
        .txt {
          opacity: 0.7;
          font-size: 12px;
          font-family: PingFangSC, PingFangSC-Regular;
          font-weight: 400;
          text-align: center;
          color: #ffffff;
          line-height: 16px;
          letter-spacing: 0px;
        }
      }
    }
    .position {
      position: absolute;
      left: 0;
      bottom: -16px;
      width: 100%;
      padding: 2px @p15;
      .cell {
        border-radius: 10px;
      }
    }
  }
  .content {
    background-color: #f7f4f5;
    padding: 26px @p15;

    .middle {
      border-radius: 10px;
      padding: 20px 15px;
      background-color: #fff;
      .middle-title {
        font-size: 14px;
        font-family: PingFangSC, PingFangSC-Semibold;
        font-weight: 600;
        text-align: left;
        color: #181a39;
        line-height: 20px;
        letter-spacing: 0px;
      }
      .middle-num {
        display: flex;
        justify-content: space-around;
        text-align: center;
        padding-top: 17px;
        .middle-num-item {
          .item-1 {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: center;
            color: #b4b4bd;
            line-height: 14px;
            letter-spacing: 0px;
            .color {
              color: #00b8d4;
            }
          }
          .item-2 {
            font-size: 21px;
            font-family: DINAlternate, DINAlternate-Bold;
            font-weight: 700;
            text-align: center;
            color: #181a39;
            line-height: 24px;
            letter-spacing: 0px;
            padding: 12px 0;
          }
          .item-3 {
            font-size: 12px;
            font-family: PingFangSC, PingFangSC-Regular;
            font-weight: 400;
            text-align: center;
            color: #545671;
            line-height: 16px;
            letter-spacing: 0px;
          }
        }
      }
    }
  }
  .bottom {
    .cell-1 {
      border-radius: 10px 10px 0 0;
    }
    .cell-2 {
      border-radius: 0 0 10px 10px;
    }
    margin-top: 12px;
  }
}
</style>
